<?php

class m131104_043435_oak extends CDbMigration
{
	public function safeUp()
	{
        $sql = 'CREATE TABLE `{{gender}}`
                (
                    `id` tinyint PRIMARY KEY,
                    `name` varchar(255),
                    `created_at` datetime,
                    `updated_at` datetime
                )
                ENGINE=InnoDB DEFAULT CHARSET=utf8;
                
                INSERT INTO `{{gender}}` VALUES(-1, "Unknow", NOW(), NOW());
                INSERT INTO `{{gender}}` VALUES(0, "Female", NOW(), NOW());
                INSERT INTO `{{gender}}` VALUES(1, "Male", NOW(), NOW());';
        
        $this->execute($sql);
	}
    
    public function safeDown()
    {
        return false;
    }
}